<%= form_for(@admin) do |f| %>
  <% if @admin.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@admin.errors.count, "error") %> prohibited this admin from being saved:</h2>

      <ul>
      <% @admin.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="actions">
    <p>
      <%= f.label :name %>
      <%= f.text_field :name %>
    </p>
    <p>
      <%= f.label :email %>
      <%= f.email_field :email %>
    </p>
    <p>
      <%= f.label :password %>
      <%= f.password_field :password %>
    </p>
    <p>
      <%= f.label :role %>
      <%= f.collection_select :role_id, Role.all, :id, :name %>
    </p>
    <%= f.submit %>
  </div>
<% end %>
